import 'package:flutter/material.dart';

class CheckBoxDemo extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => CheckBoxDemoState();
}

class CheckBoxDemoState extends State<CheckBoxDemo> {
  bool _checkBoxItem = false;
  bool _checkBoxItemA = false;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('CheckBoxDemo'),
      ),
      body: Container(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            CheckboxListTile(
              value: _checkBoxItemA,
              onChanged: (value) {
                setState(() {
                  _checkBoxItemA = value;
                });
              },
              title: Text('checkBoxItemA'),
              subtitle: Text('subscription'),
              selected: _checkBoxItemA,
              activeColor: Colors.blue,
              secondary: Icon(Icons.account_box),
            ),
            Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[

                Checkbox(
                  value: _checkBoxItem,
                  onChanged: (value) {
                    setState(() {
                      _checkBoxItem = value;
                    });
                  },
                  activeColor: Colors.blue,
                )
              ],
            )
          ],
        ),
      ),
    );
  }
}
